home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 8 / Amoszine 8 (Disk 2 of 3).adf / Powerbobs.lha / powerbobsv1.0 / examples / Dec_Array_vs_Pdec_Array.asc < prev    next >
Text File  |  1992-09-02  |  585b  |  36 lines

  1. 'This example shows the use of the Pdec command. 
  2. 'Beware...if more than 400 is entered, be sure to have a cup of tea.   
  3. '
  4. 'One arra containing 1001 elements (0 -> 1000) is first Dimensioned. 
  5. '
  6. 'Enter 0 (zero) to stop the speed test.
  7. '
  8. Dim X(1000)
  9. Do 
  10. Input "Give range, max 1000 : ";_MAX
  11. '
  12. If _MAX=0 Then End 
  13. '
  14. T=Timer
  15. For I=1 To 1000
  16.    For K=0 To _MAX
  17.       Dec X(K)
  18.    Next 
  19. Next 
  20. '
  21. 'Display the ellapsed time in Vbl's
  22. '
  23. Print Timer-T
  24. '
  25. ADRESS_X=Varptr(X(0))
  26. T=Timer
  27. For I=1 To 1000
  28.    Pdec ADRESS_X,0 To _MAX
  29. Next 
  30. '
  31. 'Display the ellapsed time in Vbl's
  32. '
  33. Print Timer-T
  34. '
  35. Loop 
  36.